package Lab02.Q17;
import java.util.Random;
class Buyers {
    public String name;
    public void SetName(String name){
        this.name=name;
    }
    public int Buy(){
        Random number=new Random(60);
        return number.nextInt(100);
    }
}
class Cooks{
    public String name;
    public void SetName(String name){
        this.name=name;
    }
    public String Cook(){
        String[] dish=new String[]{"酸辣土豆丝","红烧鲫鱼","韭菜炒蛋"};
        Random number=new Random(5);
        int num=number.nextInt(3);
        return dish[num];
    }
}
public class Question17 {
    public static void main(String[] args){
        Buyers one=new Buyers();
        one.SetName("我");
        Buyers two=new Buyers();
        two.SetName("妈妈");
        Buyers three=new Buyers();
        three.SetName("姑姑");
        System.out.println(one.name+" 花了 "+one.Buy()+"元");
        Cooks four=new Cooks();
        four.SetName("爸爸");
        Cooks five=new Cooks();
        five.SetName("婶婶");
        System.out.println(four.name+"做了"+four.Cook());
    }
}
